#include <bits/stdc++.h>

#define endl '\n'

using namespace std;

typedef long long LL;


const int mod = 1e9 + 7;

int T, m, k, n;

LL ans;

bool check(LL s, int dian, int flower)
{
	if (s > 101) return true;
	if (s - flower > 1) return true;
	
	if (s == 0)  return true;
	return false;
}

void dfs(int u, LL s, int dian, int flower)
{
	if (check(s, dian, flower)) return;
	if (u == n + m)
	{
		if (s == 1) ans ++ ;
		ans %= mod;
		return ;
	}
	
	if (dian)
	{
		dfs(u + 1, s * 2, dian - 1, flower);
	}
	if (flower)
	{
		dfs(u + 1, s - 1, dian, flower - 1);
	}
}

int main()
{
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	
	cin >> n >> m;
	
	m -- ;
	dfs(0, 2, n, m);
	
	cout << ans << endl;
	
    return 0;
}